package com.mybatisplus.mp.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mybatisplus.mp.mapper.UserMapper;
import com.mybatisplus.mp.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserControllerTest {
    @Autowired
    private UserMapper userMapper;

    @PostMapping(value = "/UserTest")
    public Object test(@RequestBody User user) {
        QueryWrapper<User> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(User::getId, 2);
        return null;
    }

    @PostMapping(value = "/UserInsert")
    public void test2(@Validated/*({User.SaveGroup.class})*/ @RequestBody User user) {
        /*UpdateWrapper<User> wrapper = new UpdateWrapper<>();
        user.setCTime(null);
        wrapper.eq("id", user.getId());*/
        System.out.println("nihao");

    }
}
